﻿using BasicInformation.ApiRead.Application.Command.Product;
using BasicInformation.Domain;
using BasicInformation.Dtos;
using BasicInformation.ErrorCode;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace BasicInformation.ApiRead.Controllers
{
    /// <summary>
    /// 产品管理——读
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ProductController : ControllerBase
    {
        IMediator mediator;

        public ProductController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        [HttpGet]
        public async Task<ApiPaging<ProductDTO>> GetProduct([FromQuery]GetProductCommand request)
        {
            return await mediator.Send(request);
        }
    }
}
